package com.zhuna.www.view;

import com.zhuna.www.po.User;
import com.zhuna.www.service.ReChargeService;
import com.zhuna.www.service.UserService;
import com.zhuna.www.service.impl.UserServiceImp1;

import java.util.Scanner;

public class ClientMenu {
    private final UserService userService = new UserServiceImp1();
    private final Scanner scanner = new Scanner(System.in);


    public void menuforclient(User user) {
        while (true) {
            System.out.println("\n=== 客户功能菜单 ===");
            System.out.println("1. 查看余额");
            System.out.println("2. 充值账户");
            System.out.println("3. 修改信息");
            System.out.println("4. 退出登录");
            System.out.print("请选择操作：");

            String choice = scanner.nextLine();

            try{
                switch (choice) {
                    case "1":
                        //展示当前用户余额
                        double amount = userService.getWalletBalanceByName(user.getName());
                        System.out.println("当前余额为："+user.getWallet_balance()+"元");

                        break;
                    case "2":
                        //向当前用户充值
                        System.out.println("请输入要充值的金额");
                    case "3":
                        System.out.println("功能还在开发中");
                    case "4":
                        return;
                }
            }catch (Exception e){
                e.printStackTrace();
            }
        }
    }



}
